package com.itheima.d6_collection_nesting;

import java.util.*;

public class Test {
    public static void main(String[] args) {
        Map<String, List<String>> map =new HashMap<>();

        List<String> cities1 =new ArrayList<>();
        Collections.addAll(cities1, "北京", "上海");
        map.put("省份1", cities1);

        List<String> cities2 =new ArrayList<>();
        Collections.addAll(cities2, "广州", "深圳");
        map.put("省份2", cities2);


        System.out.println(map);

        List<String> cities = map.get("省份1");
        for (String city : cities) {
            System.out.println(city);
        }

        map.forEach((k, v) -> {
            System.out.println(k + "=" + v);
        });
    }
}
